package com.hbnu.dataAccesss;

import org.springframework.jdbc.core.JdbcTemplate;

public class AccountDao {
    private JdbcTemplate jdbcTemplate;

    public void addMoney(Double money){
        String sql = "update tb_account set account=account + ? where username=?";
        jdbcTemplate.update(sql,money,"zhangsan");

    }
    public void reduceMoney(Double money){
        String sql ="update tb_account set account=account - ? where username=?";
        jdbcTemplate.update(sql,money,"lisi");

    }
}
